<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
	<script>
		//自定义函数，参数两个：数组，实现找差集功能
		var arr1=[1,3,5,'apple','red'];
		var arr2=[2,4,5,'apple','red'];
		function chaji(arr1,arr2){
			var arr3=[];
			for(var i=0;i<arr1.length;i++){
				if(arr1.indexOf(arr2[i])==-1){
					arr3.push(arr2[i]);
				}
				if(arr2.indexOf(arr1[i])==-1){
					arr3.push(arr1[i]);
				}
			}
			console.log(arr3);
		}
		chaji(arr1,arr2);
	</script>
</head>
<body>
	
</body>
</html>